import { createRouter, createWebHistory } from 'vue-router'

const HomeView = () =>import('../views/home/HomeView')
const Profile = ()=>import('../views/profile/Profile')
const Add = ()=>import('../views/add/Add')
const GoodsDetails = ()=>import('../views/home/GoodsDetails')
const Login = ()=>import('../views/profile/Login')
const Register = ()=>import('../views/profile/Register')
const UserSZ = ()=>import('../views/profile/UserSZ')
const SearchYM = ()=>import('../views/home/SearchYM')


const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path:'/home',
    component: HomeView,
  },{
    path:'/add',
    component: Add
  }, {
    path:'/profile',
    component: Profile
  },
  {
    path:'/goodsDetails',
    component: GoodsDetails
  },
  {
    path:'/login',
    component: Login
  },
  {
    path:'/register',
    component: Register
  },
  {
    path:'/userSz',
    component: UserSZ
  },{
    path:'/searchYm',
    component: SearchYM
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
})

export default router
